﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

using System.Net.Mail;

/// <summary>
/// Summary description for ILE_Config
/// </summary>

public class ILE_Config
{
    public ILE_Config()
    {
        mIsErrorReportToEmailEnabled = true;
		// Emails will not be sent until the below code has been modified.
        // *** Change Smtp server setting.
        // Although the code says SmtpClient, it is the setting for SMTP 'Server'!
        mSmtp = new SmtpClient("smtp.abcd.edu");

        // *** Change the Sender Email Address for Error Report feature.
        // This email address will be shown as a sendder when Error Report is received.
        mErrorReportSenderAddress = new MailAddress("ILE_Error@abcd.edu");

        // *** Change the ILE Default Email Sender Address
        // This email address will be shown as a sender's email address when emails other than Error Reports are sent from ILE
        mDefaultEmailSenderAddress = new MailAddress("ILE@abcd.edu");

        // *** Set the recipient(s) who will get an error report email when there is an error with ILE
        // Multiple recipients supported. Single recipient is also fine :)
        mErrorReportReceivers.Add("person1@abcd.edu");
        mErrorReportReceivers.Add("person2@abcd.edu");
        // mErrorReportReceivers.Add("person3@abcd.edu");


        // *** Set the Maximum Number of Sections required.
        // If you have course(s) that has more than 60 sections, please change the number as needed.
        mMaximumSectionNumber = 60;
    }

    public SmtpClient getSMTP()
    {
        return mSmtp;
    }

    public MailAddressCollection getErrorReportReceivers()
    {
        return mErrorReportReceivers;
    }

    public string getErrorReportSender()
    {
        return mErrorReportSenderAddress.Address.ToString();
    }
    public bool getIsErrorReportToEmailEnabled()
    {
        return mIsErrorReportToEmailEnabled;
    }

    public MailAddress getDefaultEmailSenderAddress()
    {
        return mDefaultEmailSenderAddress;
    }

    public string getHostURL()
    {
        return mHostURL;
    }

    public int getMaximumSectionNumber()
    {
        return mMaximumSectionNumber;
    }


    private bool mIsErrorReportToEmailEnabled;
    private SmtpClient mSmtp = new SmtpClient();
    private MailAddress mErrorReportSenderAddress;
    private MailAddress mDefaultEmailSenderAddress;
    private MailAddressCollection mErrorReportReceivers = new MailAddressCollection();
    private string mDefaultAdminUsername = string.Empty;
    private string mDefaultAdminPassword = string.Empty;

    private string mHostURL = String.Empty;

    private int mMaximumSectionNumber = 0;
}
